<template>
  <a-row v-userAuth="'E9'">
    <a-row class='mytitle'>
      <!-- <i class="icon icon-eventlog16l title-icon-style"></i> -->
      {{$t('Log-manage')}}
    </a-row>
    <a-card hoverable style="margin:1em">
      <a-tabs :defaultActiveKey='defaultActiveKey' @change="tabsChange">
        <a-tab-pane :tab="$t('Operation-log')" key='1' style="padding: 0 14px">
          <OperateLog v-if="currentTabKey=='1'"/>
          <!-- v-userAuth="'E11'" -->
        </a-tab-pane>
        <a-tab-pane :tab="$t('System-log')" key='2' style="padding: 0 14px">
          <SystemLog v-if="currentTabKey=='2'"/>
          <!-- v-userAuth="'E10'"  -->
        </a-tab-pane>
      </a-tabs>
    </a-card>
  </a-row>
</template>

<script>
import OperateLog from '@/views/operation/log_manage/subpage/OperateLog'
import SystemLog from '@/views/operation/log_manage/subpage/SystemLog'
export default {
  name: "Log",
  components: { OperateLog, SystemLog },
  data() {
    return {
      defaultActiveKey: '1',
      currentTabKey: '1',
    }
  },

  created() {
    this.currentTabKey = JSON.parse(localStorage.getItem('log_current_tab')) || '1';
    this.defaultActiveKey = JSON.parse(localStorage.getItem('log_current_tab')) || '1';
  },

  beforeDestroy() {
    localStorage.removeItem('log_current_tab');
  },

  methods: {
    //标签页切换
    tabsChange(key) {
      this.currentTabKey = key;
			localStorage.setItem('log_current_tab', JSON.stringify(key));
    },
  },


}
</script>

<style scoped>
/* :deep(.ant-tabs-nav-scroll) {
    margin-left: -8px;
} */

::v-deep .ant-card-body {
    padding: 0 !important;
}
</style>